package com.web.core.base.model;

import com.blue.core.dict.State;
import com.blue.core.tree.ITreeItem;
import com.blue.jdbc.annotation.Id;
import com.blue.jdbc.annotation.Table;
import com.blue.validation.group.SaveModel;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

@Table(name = "base_area")
public class Area implements ITreeItem
{
	@Id
	private Integer id;
	private Integer parentId;
	@Size(min = 0, max = 20, groups = { SaveModel.class }, message = "区域代码长度[0-20]")
	private String code;
	@Size(min = 0, max = 10, groups = { SaveModel.class }, message = "区域车牌代码长度[0-10]")
	private String carCode;
	@NotBlank(groups = { SaveModel.class }, message = "区域名称不能为空")
	@Size(min = 0, max = 20, groups = { SaveModel.class }, message = "区域名称长度[0-20]")
	private String name;
	private State state;
	private Integer sort;

	public Area()
	{
	}

	public Integer getId()
	{
		return id;
	}

	public void setId(Integer id)
	{
		this.id = id;
	}

	public Integer getParentId()
	{
		return parentId;
	}

	public void setParentId(Integer parentId)
	{
		this.parentId = parentId;
	}

	public String getCode()
	{
		return code;
	}

	public void setCode(String code)
	{
		this.code = code;
	}

	public String getCarCode()
	{
		return carCode;
	}

	public void setCarCode(String carCode)
	{
		this.carCode = carCode;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public State getState()
	{
		return state;
	}

	public void setState(State state)
	{
		this.state = state;
	}

	public Integer getSort()
	{
		return sort;
	}

	public void setSort(Integer sort)
	{
		this.sort = sort;
	}

}
